﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CSharp
{
    public class Button
    {
        public string Text { get; set; }

        public event EventHandler OnClick;//事件封装委托 注意：EventHnadler是一个委托
        //public EventHandler  OnClick { get; set; }
        public void Click()
        {
            if (OnClick != null)
            {
                OnClick(this, new EventArgs());
            }
        }

    }
}
